{include file="base/_meta" /}
</head>
<body>
<!-- 正文开始 -->
<div class="layui-fluid ew-console-wrapper">
    <div class="layui-card">
        <div class="layui-card-body">
            <form class="layui-form" id="formBasForm" lay-filter="formBasForm">
                <div class="layui-tab">
                    <ul class="layui-tab-title">
                        <li class="layui-this">网站设置</li>
                    </ul>
                    <div class="layui-tab-content">
                        <div class="layui-tab-item layui-show">

                            <div class="layui-form-item">
                                <label class="layui-form-label">网站名称:</label>
                                <div class="layui-input-block">
                                    <input name="site_title" placeholder="请输入" class="layui-input"
                                           value="{$data.site_title|default=''}"/>
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <label class="layui-form-label">LOGO：</label>
                                <div class="layui-input-block">
                                    <div class="layui-upload-drag" id="site_logo" onclick="upload_file('site_logo',1)">
                                        <i class="layui-icon"></i>
                                        <p>点击上传，或将文件拖拽到此处</p>
                                        <div>
                                            <hr>
                                            <div class="img_div">
                                                <img src="{$data.site_logo|default='/static/images/default_img.png'}" alt="上传成功后渲染" style="max-width: 96px">
                                                <input type="hidden" name="site_logo" value="{$data.site_logo|default=''}">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>

                        </div>

                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <button class="layui-btn" lay-filter="formBasSubmit" lay-submit>&emsp;提交&emsp;</button>
                            </div>
                        </div>

                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<!-- js部分 -->
{include file="base/_script" /}
<script>
    layui.use(['layer', 'form', 'element', 'upload', 'admin'], function () {
        var $ = layui.jquery
            , layer = layui.layer
            , form = layui.form
            , element = layui.element
            , upload = layui.upload
            , admin = layui.admin;

        form.on('submit(formBasSubmit)', function (data) {
            $.post("{:url('system/options_save')}", data.field, function (ret) {
                if (ret.code == 0) {
                    layer.msg(ret.msg, {icon: 1, time: 1500})
                } else {
                    layer.msg(ret.msg, {icon: 2, time: 1500})
                }
            })
            return false;
        });
    });
</script>
</body>
</html>
